#include <stdio.h>
#define LEN 4
int sum_2_dim_array(const int a[][LEN], int n){
	int *p;
	int sum = 0;
	for(p = a; p < a+n; ++p){
		sum += *p;
	}
	return sum;
}

int sum_2_dim_array2(const int a[][LEN], int n){
	int *p;
	int sum = 0;
	for(p = &a[0][0]; p <= &a[n-1][LEN-1]; ++p){
		sum += *p;
	}
	return sum;
}


int main(){
	const int a[2][LEN] = {{2, 3, 5, 6},{2, 4, 3, 1}};
	int sum = sum_2_dim_array(a, 2);
	int sum2 = sum_2_dim_array2(a, 2);
	printf("FOR 1 sum: %d \n", sum);
	printf("FOR 2 sum: %d \n", sum2);
}
